package com.fudan.cfg.dataset;

import java.util.Map;

import com.fudan.cfg.base.DatasetDef;
import com.fudan.run.ctx.annotation.DatasetAdapter;

@DatasetAdapter("elasticsearch")
public class ElasticsearchDataset extends DatasetDef{
	public ElasticsearchDataset(String name, String type) {
		super(name, type);
	}

	private static final String SOURCE_TAG = "source";
	private String source;

	public String getSource() {
		return source;
	}

	public void setSource(String source) {
		this.source = source;
	}

	@Override
	public DatasetDef build(Map<String, Object> configuration) {
		this.name = (String) configuration.get(NAME_TAG);
		this.type = (String) configuration.get(TYPE_TAG);
		this.source = (String) configuration.get(SOURCE_TAG);
		return this;
	}


}
